package com.order.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.order.domain.User;

/**
 * 学生的实体类
 * 
 * @author zhy
 *
 */
@Entity
@Table(name = "student")
public class Customer implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "sId")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer studentId;

	@Column(name = "studentName")
	private String studentName;

	@Column(name = "studentSex")
	private Integer studentSex;

	@Column(name = "phone1")
	private Long phone1;

	@Column(name = "phone2")
	private Long phone2;

	@Column(name = "studentAge")
	private Integer studentAge;

	@Column(name = "address")
	private String address;

	@Column(name = "lastDate")
	private String lastDate;

	@Column(name = "lastTime")
	private String lastTime;

	@Column(name = "nextDate")
	private String nextDate;

	@Column(name = "contact")
	private Integer contact;

	@Column(name = "followUp")
	private String followUp;
	
	@Column(name = "remark")
	private String remark;


	public Integer getStudentId() {
		return studentId;
	}

	public void setStudentId(Integer studentId) {
		this.studentId = studentId;
	}

	public String getStudentName() {
		return studentName;
	}

	public void setStudentName(String studentName) {
		this.studentName = studentName;
	}

	public Integer getStudentSex() {
		return studentSex;
	}

	public void setStudentSex(Integer studentSex) {
		this.studentSex = studentSex;
	}

	public Long getPhone1() {
		return phone1;
	}

	public void setPhone1(Long phone1) {
		this.phone1 = phone1;
	}

	public Long getPhone2() {
		return phone2;
	}

	public void setPhone2(Long phone2) {
		this.phone2 = phone2;
	}

	public Integer getStudentAge() {
		return studentAge;
	}

	public void setStudentAge(Integer studentAge) {
		this.studentAge = studentAge;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getLastDate() {
		return lastDate;
	}

	public void setLastDate(String lastDate) {
		this.lastDate = lastDate;
	}

	public String getLastTime() {
		return lastTime;
	}

	public void setLastTime(String lastTime) {
		this.lastTime = lastTime;
	}

	public String getNextDate() {
		return nextDate;
	}

	public void setNextDate(String nextDate) {
		this.nextDate = nextDate;
	}

	public User getAffiliatedTeacher() {
		return affiliatedTeacher;
	}

	public void setAffiliatedTeacher(User affiliatedTeacher) {
		this.affiliatedTeacher = affiliatedTeacher;
	}

	public Integer getContact() {
		return contact;
	}

	public void setContact(Integer contact) {
		this.contact = contact;
	}

	public String getFollowUp() {
		return followUp;
	}

	public void setFollowUp(String followUp) {
		this.followUp = followUp;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public String toString() {
		return "Customer [studentId=" + studentId + ", studentName=" + studentName + ", studentSex=" + studentSex
				+ ", phone1=" + phone1 + ", phone2=" + phone2 + ", studentAge=" + studentAge + ", address=" + address
				+ ", lastDate=" + lastDate + ", lastTime=" + lastTime + ", nextDate=" + nextDate + ", contact="
				+ contact + ", followUp=" + followUp + ", remark=" + remark + "]";
	}

	//多对一关系映射：多个学生所属一个老师
	@ManyToOne(targetEntity=User.class)		  
	@JoinColumn(name="affiliatedTeacher",referencedColumnName="userId")		
	private User affiliatedTeacher;

}
